home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / MacFormat 92 CD / Shareware Plus / Utilities / FolderSynchronizer 1.8.9 / PlugIn / Dialog / 00060_fHour.ls < prev    next >
Encoding:
Text File  |  2000-04-17  |  846 b   |  36 lines

  1. on keyDown
  2.   if (the key = TAB) or (the key = RETURN) then
  3.     if value(field "fHour") > 23 then
  4.       beep()
  5.     end if
  6.     set the selEnd to length(field "fMinute")
  7.     set the selStart to 0
  8.     pass()
  9.   end if
  10.   if ((the keyCode >= 123) and (the keyCode <= 126)) or (the keyCode = 51) then
  11.     pass()
  12.   end if
  13.   set myNum to value(the key)
  14.   if voidp(myNum) then
  15.     exit
  16.   end if
  17.   set myTempNum to field "fHour"
  18.   set s to the selStart
  19.   set e to the selEnd
  20.   set the selEnd to s + 1
  21.   set the selStart to s + 1
  22.   if s <> e then
  23.     set s to s + 1
  24.     put the key into char s to e of myTempNum
  25.   else
  26.     if s = 0 then
  27.       put the key before myTempNum
  28.     else
  29.       put the key after char s of myTempNum
  30.     end if
  31.   end if
  32.   if (value(myTempNum) <= 23) and (length(myTempNum) <= 2) then
  33.     put myTempNum into field "fHour"
  34.   end if
  35. end
  36.